package com.yjc.springcloud.controller;

import com.yjc.springcloud.bean.CommotResult;
import com.yjc.springcloud.bean.Payment;
import com.yjc.springcloud.service.PaymentFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create 2022-07-23 11:29
 */
@RestController
public class OrderFeignController {

    @Autowired
    PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/get/payment/{id}")
    public CommotResult<Payment> getPayment(@PathVariable("id") Long id) {
        return paymentFeignService.addPayment(id);
    }

    @GetMapping("/consumer/payment/timeout")
    public String timeOut() {
        String s = paymentFeignService.timeOuting();
        return s;
    }
}
